﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OauthProvider
{
    public interface ITokenStore
    {
        /*
         * Creates a request token for the consumer.
         * */
        IToken CreateRequestToken(IOAuthContext context);

        /*
         * Should consume a use of the request token, throwing a <see cref="OAuthException" /> on failure.
         * */
        void ConsumeRequestToken(IOAuthContext requestContext);

        /*
         * Should consume a use of an access token, throwing a <see cref="OAuthException" /> on failure.
         * */
        void ConsumeAccessToken(IOAuthContext accessContext);

        /*
         * Get the access token associated with a request token.
         * */
        IToken GetAccessTokenAssociatedWithRequestToken(IOAuthContext requestContext);

        /*
         * Returns the status for a request to access a consumers resources.
         * */
        RequestForAccessStatus GetStatusOfRequestForAccess(IOAuthContext requestContext);

        /*
         * Returns the callback url that is stored against this token.
         * */
        string GetCallbackUrlForToken(IOAuthContext requestContext);

        /*
         * Retrieves the verification code for a token
         * */
        string GetVerificationCodeForRequestToken(IOAuthContext requestContext);

        /*
         * Gets the token secret for the supplied request token
         * */
        string GetRequestTokenSecret(IOAuthContext context);

        /*
         * Gets the token secret for the supplied access token
         * */
        string GetAccessTokenSecret(IOAuthContext context);

        bool RefreshToken(IOAuthContext context);
    }
}
